﻿using System;
namespace Brainee.NeuralNetwork
{
  public interface ITrainingMethod
  {
    double Error { get; }
    uint Iterations { get; }

    double LearningRate { get; set; }
    double Momentum { get; set; } 
    uint MaxIterations { get; set; }
    double MinError { get; set; }

    bool Train (Network ann, TrainingSet set);
  
    event TrainingProgressHandler Progress;
  }

  public class TrainingProgressEventArgs : EventArgs
  {
    public bool Cancel { get; set; }
    public UInt32 Iterations { get; private set; }
    public double Error { get; private set; }

    public TrainingProgressEventArgs (UInt32 i, double e)
    {
      Cancel = false;
      Iterations = i;
      Error = e;
    }
  }

  public delegate void TrainingProgressHandler (object sender, TrainingProgressEventArgs e);
}
